********************************************************************************
* CREATING TABLES    
* File description: Creating table 6, A4.3, A4.4 and A4.5
********************************************************************************


clear all 
set more off 

use "use/final_data", clear


set more off


global controls age age2 female educ married kids unemployed
global area_controls avg_age share_poor share_loweduc share_selfemployed share_female avg_kids share_married lnp50 lnp20 lnhouseprice population


** Yitz gender analyses

*Table 7

set more off
eststo clear

eststo: areg claim_dummy yitz_muni lndispinc lndispinc2 $area_controls $controls i.year i.municipality#c.year if female==1, a(municipality) cluster(municipality) robust


eststo: areg claim_dummy yitz_muni lndispinc lndispinc2 $area_controls $controls i.year i.municipality#c.year if female==0, a(municipality) cluster(municipality) robust

esttab using "out/table6.tex", label replace se 


*Table A4.3
	

eststo clear

eststo: areg claim_dummy yitz_muni lndispinc lndispinc2 $controls $area_controls i.year i.municipality#c.year if female==1 & dispinc_2lag<=p50_muni_2lag, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc lndispinc2 $controls $area_controls i.year i.municipality#c.year if female==1 & dispinc_2lag>p50_muni_2lag, cluster(municipality) a(municipality) robust


eststo: areg claim_dummy yitz_muni lndispinc lndispinc2 $controls $area_controls i.year i.municipality#c.year if female==0 & dispinc_2lag<=p50_muni_2lag, cluster(municipality) a(municipality) robust


eststo: areg claim_dummy yitz_muni lndispinc lndispinc2 $controls $area_controls i.year i.municipality#c.year if female==0 & dispinc_2lag>p50_muni_2lag, cluster(municipality) a(municipality) robust


esttab using "out/tableA4_3.tex", label replace se 		
	
*Table A4.4

eststo clear

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if female==1 & married==0, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if female==0 & married==0, cluster(municipality) a(municipality) robust

esttab using "out/tableA4_4.tex", label replace se 		
		
	
*Table A4.5

	
drop if female==1

gen age_bracket2=0
replace age_bracket2=1 if age>14 & age<30
replace age_bracket2=2 if age>29 & age<50
replace age_bracket2=3 if age>49 & age<65
replace age_bracket2=4 if age>64 

*Panel A

eststo clear

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2==1, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2==2, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc  $ontrols $area_controls i.year i.municipality#c.year if age_bracket2==3, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2==4, cluster(municipality) a(municipality) robust

esttab using "out/tableA4_5.tex", label replace se

*Panel B		
eststo clear

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2>1 & age_bracket2<4 & married==1, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2>1 & age_bracket2<4 & married==0, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2>1 & age_bracket2<4 & married==0 & kids>0, cluster(municipality) a(municipality) robust

eststo: areg claim_dummy yitz_muni lndispinc $controls $area_controls i.year i.municipality#c.year if age_bracket2>1 & age_bracket2<4 & married==0 & kids==0, cluster(municipality) a(municipality) robust

esttab using "out/tableA4_5.tex", label append se 
